/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.can.be;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

/**
 *
 * @author Orlando ( U )
 */


@Entity
@Table(name = "CAN_TRANSACCION_GIRO_WEB")
@NamedQueries({
    @NamedQuery(name = "TransaccionGiroWeb.findAll", query = "SELECT t FROM TransaccionGiroWeb t"),
    @NamedQuery(name = "TransaccionGiroWeb.findByNombreDestinario", query = "SELECT t FROM TransaccionGiroWeb t WHERE t.nombreDestinario = :nombreDestinario"), 
    @NamedQuery(name = "TransaccionGiroWeb.findByApellidoDestinatario", query = "SELECT t FROM TransaccionGiroWeb t WHERE t.apellidoDestinatario = :apellidoDestinatario"),
    @NamedQuery(name = "TransaccionGiroWeb.findByNumeroDocumentoDestinatario", query = "SELECT t FROM TransaccionGiroWeb t WHERE t.numeroDocumentoDestinatario = :numeroDocumentoDestinatario")})
@PrimaryKeyJoinColumn(name = "ID_TRANSACCION_GIRO_WEB", referencedColumnName = "ID_TRANSACCION_WEB")
@DiscriminatorValue(value = "GIRO")

public class TransaccionGiroWeb extends TransaccionWeb implements Serializable {

    @Column(name = "NOMBRE_DESTINARIO", length = 250)
    private String nombreDestinario;
    @Column(name = "APEPAT_DESTINATARIO", length = 250)
    private String apepatDestinatario;
    @Column(name = "NUMERO_DOCUMENTO_DESTINATARIO", length = 20)
    private String numeroDocumentoDestinatario;
    @Column(name = "CLAVE", length = 10)
    private String claveDestinatario;
    @Column(name = "APEMAT_DESTINATARIO", length = 250)
    private String apematDestinatario;
    @JoinColumn(name = "FID_CAN_TIPO_DOCUMENTO", referencedColumnName = "ID_TIPO_DOCUMENTO")
    @ManyToOne(fetch = FetchType.LAZY)
    private TipoDocumento fidCanTipoDocumento;
    @JoinColumn(name = "FID_CAN_TRANSACCION_WEB", referencedColumnName = "ID_TRANSACCION_WEB")
    @ManyToOne(fetch = FetchType.LAZY)
    private TransaccionWeb fidCanTransaccionWeb;

    public TransaccionGiroWeb() {
    }

    public TransaccionGiroWeb(String nombreDestinario, String apepatDestinatario, String numeroDocumentoDestinatario, String claveDestinatario, String apematDestinatario, TipoDocumento fidCanTipoDocumento, TransaccionWeb fidCanTransaccionWeb) {
        this.nombreDestinario = nombreDestinario;
        this.apepatDestinatario = apepatDestinatario;
        this.numeroDocumentoDestinatario = numeroDocumentoDestinatario;
        this.claveDestinatario = claveDestinatario;
        this.apematDestinatario = apematDestinatario;
        this.fidCanTipoDocumento = fidCanTipoDocumento;
        this.fidCanTransaccionWeb = fidCanTransaccionWeb;
    }

   

    public TransaccionWeb getFidCanTransaccionWeb() {
        return fidCanTransaccionWeb;
    }

    public void setFidCanTransaccionWeb(TransaccionWeb fidCanTransaccionWeb) {
        this.fidCanTransaccionWeb = fidCanTransaccionWeb;
    }

    public String getApematDestinatario() {
        return apematDestinatario;
    }

    public void setApematDestinatario(String apematDestinatario) {
        this.apematDestinatario = apematDestinatario;
    }

    public String getApepatDestinatario() {
        return apepatDestinatario;
    }

    public void setApepatDestinatario(String apepatDestinatario) {
        this.apepatDestinatario = apepatDestinatario;
    }

    public String getClaveDestinatario() {
        return claveDestinatario;
    }

    public void setClaveDestinatario(String claveDestinatario) {
        this.claveDestinatario = claveDestinatario;
    }

    public TipoDocumento getFidCanTipoDocumento() {
        return fidCanTipoDocumento;
    }

    public void setFidCanTipoDocumento(TipoDocumento fidCanTipoDocumento) {
        this.fidCanTipoDocumento = fidCanTipoDocumento;
    }

    public String getNombreDestinario() {
        return nombreDestinario;
    }

    public void setNombreDestinario(String nombreDestinario) {
        this.nombreDestinario = nombreDestinario;
    }

    public String getNumeroDocumentoDestinatario() {
        return numeroDocumentoDestinatario;
    }

    public void setNumeroDocumentoDestinatario(String numeroDocumentoDestinatario) {
        this.numeroDocumentoDestinatario = numeroDocumentoDestinatario;
    }

   @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTransaccionWeb != null ? idTransaccionWeb.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TransaccionWeb)) {
            return false;
        }
        TransaccionWeb other = (TransaccionWeb) object;
        if ((this.idTransaccionWeb == null && other.idTransaccionWeb != null) || (this.idTransaccionWeb != null && !this.idTransaccionWeb.equals(other.idTransaccionWeb))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.can.be.TransaccionWeb[idTransaccionWeb=" + idTransaccionWeb + "]";
    }

//    public TransaccionWeb getFidCanTransaccionWeb() {
//        return fidCanTransaccionWeb;
//    }
//
//    public void setFidCanTransaccionWeb(TransaccionWeb fidCanTransaccionWeb) {
//        this.fidCanTransaccionWeb = fidCanTransaccionWeb;
//    }

    

}
